package per.yd.tankWar.entity;


import java.awt.Graphics;

import per.yd.tankWar.constants.ImageUrl;

public class Boom extends DisplayImage{
	
	private int time = 0;
	
	private int fresh = 20;
	
	private boolean alive = true;
		
	public Boom(int x, int y) {
		super(x, y, ImageUrl.BOOM_IMAGE_URL);
	}
	
	
	public void show(Graphics g) {
		if(time >= 300) {
			alive = false;
		} else {
			g.drawImage(getImage(), x, y, null);
			time += fresh;
		}
	}
	
	
	public boolean isAlive() {
		return alive;
	}
	
	
	public void setAlive(boolean alive) {
		this.alive = alive;
	}
	

}
